package com.gollum.system.domain.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gollum.jpa.domain.AbstractBaseEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 邮箱发送日志实体
 *
 * @author Herther
 * @createTime 2022年11月06日 18:16:00
 * @since 1.0.0
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain=true)
@Entity
@Table(name = "sys_mall_log")
public class SysMailLog extends AbstractBaseEntity {

    private static final long serialVersionUID = 1L;

    /** 邮箱主题  **/
    @Column(name = "subject",length = 100)
    private String subject;

    /** 发送的title  **/
    @Column(name = "title",length = 100)
    private String title;

    /** 发送人邮箱  **/
    @Column(name = "send_email",length = 100)
    private String sendEmail;

    /** 接收人邮箱  多人的话用逗号分隔 **/
    @Column(name = "to_email")
    private String toEmail;


    /** 发送成功或失败的消息 **/
    @Column(name = "message")
    private String message;

    /** 发送的内容 **/
    @Column(name = "content",length = 1000)
    private String content;

    /** 发送状态 0正常 1失败 **/
    @Column(name = "status",length = 10)
    private String status;


    /** 发送时间 **/
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "sender_time")
    private Date senderTime;

}
